package 多线程.复习.线程方法;

public class InterruptedOfThread {
    private static class MyRun implements Runnable{

        @Override
        public void run() {
            for (int i = 0; i < 5; i++) {
                System.out.println("会清除 ：" +Thread.interrupted());//会清楚中断标志的方法
//                System.out.println("不会清除 ：" +Thread.currentThread().isInterrupted());//不会清除中断标志的方法
            }
        }
    }

    public static void main(String[] args) {
        Thread thread = new Thread(new MyRun());
        thread.start();
        thread.interrupt();
    }
}
